import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;


@DisplayName("恒温烧水器测试用例")
class HeaterTest {

    @Test
    @DisplayName("当水温低于最低温度且有水时，热水器应该转换为烧水状态")
    void when_has_water_and_temperature_lower_the_lowest_should_convert_to_on_status() {
        Heater heater = new Heater();
        heater.setEmptyWater(false);
        heater.fire(Event.turnOn);
        State state = heater.getCurrentState();
        heater.setState(state);
    }

    @Test
    @DisplayName("当水温低于最低温度且没水，烧水器应该保持为关闭状态")
    void when_no_water_and_temperature_lower_the_lowest_should_stay_off_status() {
        Heater heater = new Heater();
        heater.setEmptyWater(true);
        heater.fire(Event.turnOn);
        State state = heater.getCurrentState();
        heater.setState(state);
    }

    @Test
    @DisplayName("当烧水器不能接受当前事件")
    void when_no_config_specified_event_should_throw_exception() {
        Heater heater = new Heater();
        heater.setEmptyWater(true);
    }
}